//hoisting
var str1 = 'str1';

function fn1() {
  var str2 = 'str2'; 
  console.log(str1 + '--' + str3);
}

var str3 = 'str3'; //hoisting 变量提升

function fn2() {
  console.log('str2=' + str2)//str2 is not defind
}

fn1()
fn2()